package com.beauty.dressing.rxandroid.api;

import com.beauty.dressing.common.bean.BaseParse;
import com.beauty.dressing.common.bean.ExtraParser;
import com.beauty.dressing.common.bean.LeaseOrderResp;
import com.beauty.dressing.common.bean.LeaseReadyPayResultBean;
import com.beauty.dressing.common.bean.SalesOrderResp;
import com.beauty.dressing.common.bean.ShopCart;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * 对应后台/order工程
 *
 * @author xutingz
 * @E-mail xutz@xianlanba.com
 * @date 2018/04/11
 */

public interface OrderApi {


    @FormUrlEncoded
    @POST("leaseOrder")
    Observable<BaseParse<LeaseOrderResp, Object>> createLeaseOrder(@FieldMap Map<String, String> map); //租赁下单

    @FormUrlEncoded
    @POST("salesAddCart")
    Observable<BaseParse<Object, Object>> saleAddShopcar(@FieldMap Map<String, String> map); //销售区，添加购物车

    @FormUrlEncoded
    @POST("salesShowCart")
    Observable<ExtraParser<Object, ShopCart>> getShopcarList(@FieldMap Map<String, String> map); //购物车列表

    @FormUrlEncoded
    @POST("salesDeleteCart")
    Observable<BaseParse<Object, Object>> deleteShopcar(@FieldMap Map<String, String> map); //删除购物车

    @FormUrlEncoded
    @POST("leaseDirectOrder")
    Observable<BaseParse<SalesOrderResp, Object>> createSalesOrder(@FieldMap Map<String, String> map); //商品详情下订单

    @FormUrlEncoded
    @POST("salesOrder")
    Observable<BaseParse<SalesOrderResp, Object>> createSalesOrderFromCart(@FieldMap Map<String, String> map); //购物车下订单

    @FormUrlEncoded
    @POST("leaseReadyPay")
    Observable<BaseParse<LeaseReadyPayResultBean, Object>> leaseReadyPay(@FieldMap Map<String, String> map); //租赁区去付款


}
